
<form name="editForm" role="form" novalidate ng-submit="vm.save()">

    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
                ng-click="vm.clear()">&times;</button>
        <h4 class="modal-title" id="myAdvertisementLabel" data-translate="milkbeeApp.advertisement.home.createOrEditLabel">Create or edit a Advertisement</h4>
    </div>
    <div class="modal-body">
        <jhi-alert-error></jhi-alert-error>
        <div class="form-group" ng-show="vm.advertisement.id">
            <label for="id" data-translate="global.field.id">ID</label>
            <input type="text" class="form-control" id="id" name="id"
                    ng-model="vm.advertisement.id" readonly />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.title" for="field_title">Title</label>
            <input type="text" class="form-control" name="title" id="field_title"
                    ng-model="vm.advertisement.title"
                     />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.image" for="field_image">Image</label>
            <input type="text" class="form-control" name="image" id="field_image"
                    ng-model="vm.advertisement.image" ng-show="false"
                     />
            <div class="progress" ng-show="vm.doUpload">
  				<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="{{vm.currentProcess}}" aria-valuemin="0" aria-valuemax="100" style="width: {{vm.currentProcess}}%">
  				</div>
			</div>
            <input type="file" class="form-control" name="imageFile" accept="image/*" id="field_image_upload" ngf-select="vm.onImageSelect($files)" />
   
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.startAt" for="field_startAt">Start At</label>
                <div class="input-group">
                    <input id="field_startAt" type="text" class="form-control" name="startAt" datetime-picker="{{dateformat}}" ng-model="vm.advertisement.startAt" is-open="vm.datePickerOpenStatus.startAt"
                     datepicker-options="vm.datepickerOptions" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default" ng-click="vm.openCalendar('startAt')"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </div>
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.endAt" for="field_endAt">End At</label>
                <div class="input-group">
                    <input id="field_endAt" type="text" class="form-control" name="endAt" datetime-picker="{{dateformat}}" ng-model="vm.advertisement.endAt" is-open="vm.datePickerOpenStatus.endAt"
                      datepicker-options="vm.datepickerOptions" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-default" ng-click="vm.openCalendar('endAt')"><i class="glyphicon glyphicon-calendar"></i></button>
                    </span>
                </div>
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.weblink" for="field_weblink">Weblink</label>
            <input type="url" class="form-control" name="weblink" id="field_weblink"
                    ng-model="vm.advertisement.weblink"
                     />
        </div>
        <div class="form-group">
            <label class="control-label" data-translate="milkbeeApp.advertisement.categoryId" for="field_categoryId">Category Id</label>
            <input ng-show="false" type="number" class="form-control" name="categoryId" id="field_categoryId"
                    ng-model="vm.advertisement.categoryId"
                     />
            <select class="form-control" name="se_category" id="se_field_category" ng-options="item as item.name for item in vm.categories"
            ng-model="vm.category" ng-change="vm.onCategoryChange()" >
            </select>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="vm.clear()">
            <span class="glyphicon glyphicon-ban-circle"></span>&nbsp;<span data-translate="entity.action.cancel">Cancel</span>
        </button>
        <button type="submit" ng-disabled="editForm.$invalid || vm.isSaving" class="btn btn-primary">
            <span class="glyphicon glyphicon-save"></span>&nbsp;<span data-translate="entity.action.save">Save</span>
        </button>
    </div>
</form>
